package com.kotlin.hxh.base

import android.app.Activity
import android.content.Context
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import com.kotlin.hxh.R

/**
 * @author huxh
 * @date 2018/12/17.
 */
open class BaseBackFragment : Fragment() {
    var _mActivity: Activity? = null
    override fun onAttach(context: Context) {
        super.onAttach(context)
        _mActivity = activity
    }

    fun initToolbarNav(toolbar: Toolbar) {
        toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp)
        toolbar.setNavigationOnClickListener {
            _mActivity?.onBackPressed()
        }
    }

}